import { _get, _post } from "../../utils/request";
import util from "../../utils/util";
const app = getApp();
Page({
    data: {},
    getFujian() {
        _get(`/testResult/getAccessory`, { vbizId: app.vbizId }).then(res => {
            console.log('附件', res.data);
            console.log(res.data[0].url.substr(res.data[0].url.length - 1, 1));
            this.setData({
                fujian: res.data
            })
        })
    },
    downLoad(e) {
        console.log(e);
        dd.downloadFile({
            url: e.target.dataset.src,
            success({ filePath }) {
                dd.previewImage({
                    urls: [filePath],
                });
            },
            fail(res) {
                dd.alert({
                    content: res.errorMessage || res.error,
                });
            },
        });
    },
    downLoad1(e) {
        console.log(e);
        dd.downloadFile({
            url: e.target.dataset.src,
            success({ filePath }) {
                console.log('filePath', filePath);
            },
            fail(res) {
                dd.alert({
                    content: res.errorMessage || res.error,
                });
            },
        });
    },
    home() {
        dd.reLaunch({
            url: '/pages/home/home'
        })
    },
    onLoad() {
        dd.setNavigationBar({
            title: "附件",
            backgroundColor: "#142e4f",
            success() {},
            fail() {},
        });
        this.getFujian()
    },
});